<!-- 微信链接中转页（引导提示页） -->
<template>
  <div>
    <yz-wechat-share-img v-model="showWechatshar" :text="shareText"></yz-wechat-share-img>
  </div>
</template>

<script>
import yzWechatShareImg from "components/ui_components/yz_wechatShareImg";

export default {
  data () {
    return {
      showWechatshar: true,
      shareText: '点击右上角“...”，选择在浏览器中打开'
    };
  },

  activated() {
    if(this.$route.query.text) this.shareText = this.$route.query.text;//修改提示文字
    if(this.$route.query.path && !this.fun.isWeiXin()) {//获取链接上的path，在非微信环境上，直接跳转
      window.location.href = this.$route.query.path;
    }
  },

  components: { yzWechatShareImg },
  methods: {},
  watch: {
    showWechatshar(val) {
      if(!val) {
        if (window.history.length <= 1) {
          this.$router.push(this.fun.getUrl("home", {}));
        } else {
          this.$router.go(-1);
        }
      }
    }
  }
}

</script>
<style lang='scss' rel='stylesheet/scss' scoped>
</style>